Word Embeddings: Encoding Lexical Semantics
https://pytorch.org/tutorials/beginner/nlp/word_embeddings_tutorial.html
#PyTorch_NLP_beginner_tutorial
lexical semantics(語彙の意味)
導入(Word Embeddings: Encoding Lexical Semantics)
Getting Dense Word Embeddings
👉Word Embeddingsはニューラルネットワークが学習する
Word Embeddings in Pytorch
An Example: N-Gram Language Modeling
直前の2語で単語を表す例
([word[0], word[1]], word[2])
直前の2語がcontext、表される語がtarget
NLLLoss (Example: An LSTM for Part-of-Speech Taggingでも使った)
バイグラムの1つ1つについてzero_gradしている
Recall that torch *accumulates* gradients. Before passing in a new instance, you need to zero out the gradients from the old instance
Continuous Bag-of-WordsのExerciseもあり